﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/MasterPage.Master" AutoEventWireup="true" CodeBehind="AddEvents.aspx.cs" Inherits="DrivingCRM.Views.Private.CRM.AddEvents" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="banniere" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="nav" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="contenu" runat="server">
    <table>
    <tr>
        <td>Type:</td>
        <td>
            <asp:DropDownList ID="DDL_Type" runat="server">
                <asp:ListItem Text="Cours de code" Value="Cours de code"/>
                <asp:ListItem Text="Examen de code" Value="Examen de code"/>
                <asp:ListItem Text="Cours de conduite" Value="Cours de conduite"/>
                <asp:ListItem Text="Examen de conduite" Value="Examen de conduite"/>
                <asp:ListItem Text="Cours sur plateau" Value="Cours sur plateau"/>
                <asp:ListItem Text="Examen du plateau" Value="Examen du plateau"/>
            </asp:DropDownList> 
        </td>
    </tr>
    <tr>
        <td>Durée (en heures):</td>
        <td>
            <asp:DropDownList ID="DDL_Duration" runat="server">
                <asp:ListItem Text="1" Value="1" />
                <asp:ListItem Text="2" Value="2" />
                <asp:ListItem Text="3" Value="3" />
                <asp:ListItem Text="4" Value="4" />
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td>Date et heure (ex: 01/12/2010 08:00):</td>
        <td>
            <telerik:RadDateTimePicker ID="DP_DateWithHour" runat="server" Skin="Default">
                <TimeView runat="server" CellSpacing="-1" Culture="fr-FR"></TimeView>

                <TimePopupButton ImageUrl="" HoverImageUrl=""></TimePopupButton>

                <Calendar runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" 
                                    ViewSelectorText="x"></Calendar>

                <DateInput runat="server" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy"></DateInput>

                <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
            </telerik:RadDateTimePicker>
            <asp:RequiredFieldValidator ID="DateWithHourRequired" runat="server" 
                        ControlToValidate="DP_DateWithHour" ErrorMessage="La date et l'heure sont requis." 
                        ToolTip="La date et l'heure sont requis." ValidationGroup="AddNewEvent">*</asp:RequiredFieldValidator>
        </td>
    </tr>
    <asp:UpdatePanel ID="UP_AgencyStakeholder" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <tr>
                <td>Agence:</td>
                <td>
                    <asp:DropDownList ID="DDL_Agencies" runat="server" 
                        DataSourceID="DS_Agencies"
                        DataTextField="Name"
                        DataValueField="IdAgency" AutoPostBack="true">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>Intervenant:</td>
                <td>
                    <asp:DropDownList ID="DDL_Stakeholder" runat="server" 
                        DataSourceID="DS_Stakeholder"
                        DataTextField="CompleteName"
                        DataValueField="Id">
                    </asp:DropDownList>
                </td>
            </tr>
        </ContentTemplate>
    </asp:UpdatePanel>
    <tr>
        <td>
            <asp:Button ID="B_AddEvent" runat="server" Text="Ajouter évènement" onclick="B_AddEvent_Click" />
        </td>
   
    </tr>
    <tr>
        <td>
            <asp:Label ID="L_ErrorMessage"  runat="server" />
        </td>
    </tr>
    </table>

    <asp:EntityDataSource ID="DS_Agencies" runat="server" 
        ConnectionString="name=Model_DrivingCRMContainer" 
        DefaultContainerName="Model_DrivingCRMContainer" EntitySetName="AgencySet">
    </asp:EntityDataSource>

    <asp:EntityDataSource ID="DS_Stakeholder" runat="server" 
        ConnectionString="name=Model_DrivingCRMContainer" 
        DefaultContainerName="Model_DrivingCRMContainer" EnableFlattening="False" 
        EntitySetName="UserSet" EntityTypeFilter="Stakeholder"
        Where="it.AgencyIdAgency == @IdAgency">
        <WhereParameters>
            <asp:ControlParameter DbType="Int32" Name="IdAgency" ControlID="DDL_Agencies" PropertyName="SelectedValue" />
        </WhereParameters>
    </asp:EntityDataSource>

</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="footer" runat="server">
    Copyright DrivingCRM - 2011
</asp:Content>
